package com.yj.ccs.abs.common.enums;

/**
 * Copyright 2018 (C) Yunjian-VC
 * Created on : 2018/3/20
 * Author     : Unbelievable9
 **/
public enum AssetGuaranteeType {

    /**
     * 1 - 无
     * 2 - 信用
     * 3 - 一般保证
     * 4 - 最高额保证
     * 5 - 一般抵押
     * 6 - 最高额抵押
     * 7 - 质押
     */
    NONE(1),
    CREDIT(2),
    COMMON_GUARANTEE(3),
    MAX_GUARANTEE(4),
    COMMON_MORTGAGE(5),
    MAX_MORTGAGE(6),
    PLEDGE(7);

    private Integer value;

    AssetGuaranteeType(Integer value) {
        this.value = value;
    }

    public Integer getValue() {
        return value;
    }

    public static AssetGuaranteeType fromValue(Integer value) {
        for (AssetGuaranteeType assetGuaranteeType : AssetGuaranteeType.values()) {
            if (assetGuaranteeType.getValue().equals(value)) {
                return assetGuaranteeType;
            }
        }

        return null;
    }
}
